import { eLayoutType, RoutesService } from '@abp/ng.core';
import { eSettingManagementRouteNames } from '@abp/ng.setting-management';
import { eThemeSharedRouteNames } from '@abp/ng.theme.shared';
import { APP_INITIALIZER } from '@angular/core';

export const SETTING_MANAGEMENT_ROUTE_PROVIDERS = [
  { provide: APP_INITIALIZER, useFactory: configureRoutes, deps: [RoutesService], multi: true },
];

export function configureRoutes(routes: RoutesService) {
  return () => {
    routes.add([
      {
        path: '/setting-management',
        name: eSettingManagementRouteNames.Settings,
        parentName: eThemeSharedRouteNames.Administration,
        iconClass: 'setting',
        layout: eLayoutType.application,
        order: 100,
      },
    ]);
  };
}
